﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Routing
{
    class Common
    {
        public int RANDOM( int mix, int max )
        {
            Random random = new Random();
            return random.Next(mix, max);
        } // MAX

		public int MIN( float[] arr )
		{
			int min = int.MaxValue;
			int idx = 0;

			for (int i = 0; i < arr.Length; i++)
			{
				if (arr[i] == 0)
					continue;

				if ( min > arr[i] )
				{
					min = (int) arr[i];
					idx = i;
				}
			}

			return idx;
		} // MIN
    }
}
